package ac.svn.accesscontrol.store;

import java.util.HashSet;
import java.util.Set;

public class SVNLocation implements ISVNItem ,Comparable<SVNLocation>{
	private String locationPath;
	private String locationName;
	private Set<ISVNItem> accessUnits;



	public String getLocationPath() {
		return locationPath;
	}
	public void setLocationPath(String locationPath) {
		this.locationPath = locationPath;
	}
	public String getLocationName() {
		return locationName;
	}
	public void setLocationName(String locationName) {
		this.locationName = locationName;
	}
	public Set<ISVNItem> getAccessUnits() {
		return accessUnits;
	}

	public void addAccessUnit(AccessUnit accessUnit)
	{
		this.accessUnits.add(accessUnit);
	}

	public void removeAccessUnit(AccessUnit accessUnit )
	{
		this.accessUnits.remove(accessUnit);
	}
	@Override
	public String toString() {
		return "SVNLocation [locationPath=" + locationPath + ", locationName="
		+ locationName + ", accessUnits=" + accessUnits + "]";
	}
	public SVNLocation() {
		super();
		accessUnits = new HashSet<ISVNItem>(); 
	}
	@Override
	public String getName() {
		return getLocationName();
	}
	@Override
	public int compareTo(SVNLocation o) {
		return locationPath.compareTo(o.getLocationPath());
	}
	@Override
	public String getTooltipText() {
		return "<HTML>SVNLocation <br>LocationPath=" + locationPath + "<br>LocationName="
		+ locationName + "<br>AccessUnits=" + accessUnits + "</HTML>";
	}






}
